<{include file='public/meta' /}

<title>添加管理员 - 管理员管理 - H-ui.admin v3.0</title>
</head>
<body>

<article class="cl pd-20">
	<form action="" method="post" class="form form-horizontal" id="form-admin-add">
		<table class="table table-border table-bordered table-bg">
			
			<thead>
				<tr>
					<th scope="col" colspan="9">信息列表</th>
				</tr>
					
				<tr>
					<th colspan="1">年度：&nbsp;<span id = 'yy'>{$list_data.yy}</span></th>
					<th colspan="1">月份：&nbsp;<span id = 'mm' >{$list_data.mm}</span></th>
					<th colspan="1">周度：&nbsp;<span id = 'ww'>{$list_data.ww}</span></th>
					<th colspan="1">厂商：&nbsp;<span id = 'oem'>{$list_data.oem}</span></th>
				</tr>
				
				<tr class="text-c">
					<th width="100">品牌</th>
					<th width="100">车型</th>
					<th width="100">批发</th>
					<th width="100">零售</th>
				</tr>
			</thead>
			<tbody>
			
			{volist name="res" id="vo"}
				<tr class="text-c">
					<td>{$vo.bname}</td>
					<td>{$vo.aname}</td>
					<td><input type="text" name = "{$vo.wholesale_name}"></td>
					<td><input type="text" name = "{$vo.retail_name}"></td>
				</tr>
			{/volist}
			<tr class="text-c">
					<th colspan="2">合计</th>
					<th></th>
					<th></th>
					
				</tr>
			</tbody>
		</table>
		
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-10 col-sm-offset-10">
				<input class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" id="submit">
				<font id = "mes" style="position:relative; left: 50px;"></font>
			</div>
		</div>
	</form>


</article>

{include file="public/footer" /}

<script>
	
	$(function(){

        $("#submit").click(function(){
        	// alert($('#ww').val());
            $.ajax({
				type: "POST",
				url: 'http://localhost/myphp8/public/index/data/addData'+'/yy/'+$('#yy').text()+'/mm/'+$('#mm').text()+'/ww/'+$('#ww').text()+'/oem/'+$('#oem').text(),
				data: $("#form-admin-add").serialize(),
				dataType: "json",
				success: function(data){
					alert(data.message);
					// window.location.reload(); //重新加载页面,显示所有数据
					window.location.href = 
					'http://localhost/myphp8/public/index/data/dataEditView'+'/dname/'+$('#oem').text()+'/yy/'+$('#yy').text()+'/mm/'+$('#mm').text()+'/ww/'+$('#ww').text();
				}
			});

		});

	})
</script>


</body>
</html>